/* 
 * File:   File.h
 * Author: Guilherme Monteiro
 *
 */

#ifndef FILE_H
#define	FILE_H
#include <string>
#include <vector>
#include <fstream>
#include <iostream>
#include <err.h>
#include <cstdio>
#include <cstring>

#include "../headers/InvalidFileException.h"

using namespace std;

class File {
public:
    File(string path) throw (InvalidFileException);
    File(const File& orig);
    virtual ~File();
    void writeLine(string line) throw (InvalidFileException);
    vector<string> readLines();
    
    void open() throw (InvalidFileException);
    void close();
    
    void writeHeader1(string header);
    void writeHeaderN(string header);
protected:
    string path;
    fstream file;
    
    void setPath(string p) throw (InvalidFileException);
};

#endif	/* FILE_H */

